Skip to content

Fix: Convert branch names to valid Composer dev-branch format #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fballiano
Copy link
Contributor

@fballiano fballiano commented May 29, 2025

When building nightly packages, branch names like "develop" or "master" were being used directly as version strings, causing Satis to fail with "Invalid version string" errors. This fix ensures all branch names are converted to Composer's dev-branch format (e.g., "develop" → "dev-develop").

Changes:

  • package-modules.js: Update chooseNameAndVersion() to convert branch names from composer.json files or git refs to dev-branch format
  • package-modules.js: Update createComposerJsonOnlyPackage() to convert branch refs to dev-branch format for package filenames
  • release-branch-build-tools.js: Remove early conversion of branch refs that was causing issues with version determination

It's hard to test this fix, but I've been able to run act schedule --container-architecture linux/amd64 -W .github/workflows/build-mageos-nightly.yml and make it finish with no problem (except not being able to push the mirror because of missing secrets on my local build).

This is very delicate cause it could impact the normal mirror/release building processes.

Fixes #171

  When building nightly packages, branch names like "develop" or "master" were being used directly as version strings, causing Satis to fail with "Invalid version string" errors. This fix ensures all
  branch names are converted to Composer's dev-branch format (e.g., "develop" → "dev-develop").

  Changes:
  - package-modules.js: Update chooseNameAndVersion() to convert branch names from composer.json files or git refs to dev-branch format
  - package-modules.js: Update createComposerJsonOnlyPackage() to convert branch refs to dev-branch format for package filenames
  - release-branch-build-tools.js: Remove early conversion of branch refs that was causing issues with version determination

  The fix handles multiple scenarios:
  1. When version comes from composer.json containing a branch name
  2. When no version exists and git ref is a branch
  3. When creating package filenames from branch refs

  This ensures compatibility with Composer's version constraints and allows Satis to properly process packages from development branches.
@fballiano fballiano requested a review from a team as a code owner May 29, 2025 22:22
@rhoerr
Copy link
Contributor

rhoerr commented Jun 1, 2025

Code looks good to me in theory. I need to test the various build types with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: nightly builds broken
2 participants